<template>
<uni-shadow-root class="partials-imgPopup-imgPopup"><view :style="'display:'+(display)">
  <view class="bg"></view>
  <view class="close" @click="closeFun" :data-url="someData.imageUrl">x</view>
  <view class="concent">
    <image mode="aspectFit" :src="someData.imageUrl" :data-url="someData.imageUrl" @click="tolinkUrl"></image> 
    <view class="price">支付金额：{{someData.price}}</view>
  </view>
</view></uni-shadow-root>
</template>

<script>

global['__wxRoute'] = 'partials/imgPopup/imgPopup'
const app = getApp();
Component({
  properties: {
    data: {
      type: JSON,
      value: 'default value',
    }
  },
  data: {
    someData: {},
    display:"block"
  },
  ready:function(){
    console.log("imgPopup数据", this.data.data)
    let that=this;
    this.setData({
      display: 'block',
      someData: this.data.data
    })
  },
  methods: {
    tolinkUrl: function (event) {
      console.log(event.currentTarget.dataset.link)
      console.log("===========e==========", event.currentTarget.dataset.url)
      try {
        wx.setStorageSync('popimage', event.currentTarget.dataset.url)
      } catch (e) {
      }
      this.setData({
        display: 'none'
      })
      app.globalData.linkEvent(event.currentTarget.dataset.link);

    },
    closeFun:function(e){
      console.log("===========e==========", e.currentTarget.dataset.url)
      try {
        wx.setStorageSync('popimage',e.currentTarget.dataset.url)
      } catch (e) {
      }
      this.setData({
        display:'none'
      })
    }
  },
})
export default global['__wxComponents']['partials/imgPopup/imgPopup']
</script>
<style platform="mp-weixin">
.bg{
  position: fixed;
  width:100%;
  height: 100%;
  top:0;
  left: 0;
  background: #000;
  opacity:0.6;  
  -moz-opacity:0.6;
  -khtml-opacity: 0.6;
  z-index:1000;
}
.concent{
  width:550rpx;
  position:fixed;
  top:50%;
  height:700rpx;
  left:50%;
  z-index:1001;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  align-items:center;
  margin-left:-275rpx;
  margin-top:-400rpx;
}
.concent image{
  width: 100%;
  height: 100%;
}
.close{
 position:fixed;
  bottom:50rpx;
  right:50%;
  width:70rpx;
  height:70rpx;
  border-radius:50rpx;
  border:1px solid white;
  color:#fff;
  line-height:65rpx;
  text-align:center;
  z-index:1002;
  margin-right:-35rpx;
  font-size:40rpx;
}
.price{
  color: #fff;
  font-size: 36rpx;
  margin-top: 10rpx;
}
</style>